export interface ModelProvider {
  id: string
  name: string
  baseURL: string
  defaultModel: string
  models: ModelInfo[]
  apiKeyEnvVar: string
  description?: string
}

export interface ModelInfo {
  id: string
  name: string
  maxTokens?: number
  description?: string
  pricing?: {
    input: number
    output: number
    unit: string
  }
}

export interface ChatMessage {
  role: 'system' | 'user' | 'assistant'
  content: string
}

export interface ChatCompletionRequest {
  model: string
  messages: ChatMessage[]
  max_tokens?: number
  temperature?: number
  top_p?: number
  frequency_penalty?: number
  presence_penalty?: number
  stream?: boolean
}

export interface ChatCompletionResponse {
  id: string
  object: string
  created: number
  model: string
  choices: {
    index: number
    message: {
      role: string
      content: string
    }
    finish_reason: string
  }[]
  usage: {
    prompt_tokens: number
    completion_tokens: number
    total_tokens: number
  }
}

export interface AIServiceConfig {
  currentProvider: string
  apiKeys: Record<string, string>
  settings: {
    temperature: number
    maxTokens: number
    topP: number
  }
}